MySQL common index, unique index, primary index, foreign key index, composite index, full-text index usage, mysql full-text index1. Common Index The only task of a common
_ Id Index
An index is automatically created for the _ id field for all sets except the set of capacity. This is a special index and cannot be deleted. The _ id index forces that its keywords are unique (except for some scenarios in the partition environment ).
The _ id value remains unchanged.
Tags: mysql normal index unique index primary index foreign key index1. General Index The only task for a normal index (an index defined by the keyword key or index) is to speed up acce
Label:MySQL Index concept:Say the MySQL index, see a few example: index is like a book directory, it will let you find content faster, obviously the directory (index) is not the more the better, if the book 1000 pages, 500 is also the directory, it is of course inefficient, the directory is to occupy the paper, and the
Label:MySQL various index differences:Normal index: The most basic index, without any restrictionsUnique index: Similar to "normal index", the difference is that the value of the indexed column must be unique, but a null value is allowed.Primary KEY
This article mainly summarizes the MySQL index operation methods, including creating indexes, rebuilding indexes, querying indexes, and deleting indexes. In the following example, 'table _ name' indicates the data table name, 'index _ name' indicates the index name, and column list indicates the Field list (for example, 'id ', 'order _ id ').
1. Create an
1. CREATE index
The creation of the index can be done in the CREATE TABLE statement, or you can add indexes to the table separately with the CREATE INDEX or ALTER TABLE. The following command statements show how to create a primary key index (PRIMARY key), a federated Index
Tags: except composite index end use key read-write min causes the specifiedFirst, insert two records into the Users collection, and then use the Users collection for a demonstration of index management:> user1={"name":"liming","age":20,"gender":"F"}{ "name" : "liming", "age" : 20, "gender" : "F" }> db.users.insert(user1)WriteResult({ "nInserted" : 1 })> user2={"name":"zhangsan","age":25,"gender":"F"}{ "nam
Label:Original: MySQL primary key index, unique index, normal index, full-text index, composite index differenceMySQL index concept:Say the MySQL index, see a few example:
---- Set a non-primary key to clustered index [Step 4] to: http://king123654789.iteye.com/blog/1169191
1. View All indexes. Clustered indexes are created on the primary key by default.Sp_helpindex person
2. -- delete the primary key constraint and remove the index constraint on the primary key queried in [1], for example, PK _ person _ 117F9D94. Remove the primary key constraint from the primary key field
clustered index, nonclustered index, nonclustered unique indexWe all know that establishing an appropriate index can improve query speed and optimize queries. First, whether a clustered or nonclustered index is a B-tree structure .
The
clustered index matches th
Label:clustered index, nonclustered index, nonclustered unique index We all know that establishing an appropriate index can improve query speed and optimize queries. First, whether a clustered or nonclustered index is a B-tree structure .
The
clustered
Description: Red font to pay special attention to the point
An index is an object created on a database table or view to speed up queries on a table or view.
Grouped by storage: clustered and nonclustered indexesAccording to the maintenance and Management index angle: Unique index, composite index and system autom
First, index
MongoDB provides a variety of index support, indexed information is kept in system.indexes, and the default is always to create an index for _id, which uses the same relational database as MySQL. In fact, it can be said that the index is over the data storage system on top of the other layer of system, so
Clustered index, nonclustered index, nonclustered unique indexWe all know that establishing an appropriate index can improve query speed and optimize queries. First, whether a clustered or nonclustered index is a B-tree structure .
The clustered index matches the pr
Label:Unique indexIf the primary key is not set to a clustered index when it is created, it must be a unique nonclustered index. In fact, the unique index, the name Incredibles, is that it requires the value on that column to be unique.A unique index guarantees that the index
【Abstract】 this is an excerpt from Chapter 6 of MySQL performance optimization and architecture design. [Topic] Hash index B-Tree Index [content] 1. the Hash index has a very high retrieval efficiency because of its special structure. The index retrieval can be located at a time. Unlike B-Tree indexes, it can be access
1. Index functionIn addition to the ordered lookups mentioned above, the database uses a variety of fast location techniques to greatly improve the query efficiency. In particular, when the amount of data is very large and the query involves more than one table, using an index can often speed up the query by tens of thousands of times.For example, there are 3 unindexed tables T1, T2, T3, each containing onl
Tag:ioar use spon data div problem log Database indexing commonly used rules are as follows: 1, the table of the primary key, foreign keys must be indexed, 2, the data volume of more than 300 of the table should be indexed; 3. Tables that are frequently connected to other tables should be indexed on the Join field, 4, fields that often appear in the WHERE clause, especially large table fields, should be indexed ; 5, the index should be built on the fi
MySQL B-tree index and INDEX OPTIMIZATION, and mysqlb-Tree Index
MySQL MyISAM and InnoDB engines use B + tree indexes by default ("BTREE" is displayed during queries). This article discusses two issues:
Why is the index structure of B + tree selected for mainstream databases such as MySQL?
How to understand the comm
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.